package com.xiaojie.feign;

import com.xiaojie.feign.dto.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 参数绑定代码实例
 *
 * @Author: wangye
 * @Date: 2022/1/13 13:49
 * @return:
 **/
@FeignClient("HYSTRIX-RIBBON-EXAMPLE")
public interface FeignParam {

    @RequestMapping(value = "/server/param/test", method = RequestMethod.GET)
    String test(@RequestParam("name") String name);

    @RequestMapping("/server/param/test2")
    User test2(@RequestParam("name") String name);

    @RequestMapping("/server/param/test3")
    String test3(@RequestBody User user);

}
